package com.wejoy.video.middle.station.data.enums.dict;

/**
 * 数据状态枚举
 *
 * @author admin
 */
public enum EnumSysLogType {
    /**
     * The new.
     */
    LOG(1, "普通日志"),

    EXCEPTION_LOG(2, "异常日志"),
    ;

    private Integer code;
    private String text;

    EnumSysLogType(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    /**
     * 通过code获得该枚举类型
     *
     * @param code
     * @return
     */
    public static EnumSysLogType getByCode(Integer code) {
        EnumSysLogType[] values = EnumSysLogType.values();
        for (EnumSysLogType type : values) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        return null;
    }
}
